Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firtool] Add option to disable layer sink #7981

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

youngar
Copy link
Member

@youngar youngar commented Dec 13, 2024

The layer sink pass is showing some performance problems, and we want the ability to turn it off to work around the issue, until we can properly fix it.

@youngar youngar added the FIRRTL Involving the `firrtl` dialect label Dec 13, 2024
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments.

This is expected to be short-lived while ALS gets turned on, so the design isn't hugely important.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this is short lived, should this include updates to the C-API?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the CAPI has been kept up to date properly, but I can try to figure this out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment on lines 231 to 238
if (opt.shouldDisableLayerSink()) {
if (opt.shouldAdvancedLayerSink())
pm.nest<firrtl::CircuitOp>().addPass(
firrtl::createAdvancedLayerSinkPass());
else
pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
firrtl::createLayerSinkPass());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we now have two options, it doesn't seem great that ALS is gated by another option. I.e., -advanced-layer-sink has no effect if -disable-layer-sink is set.

Would it be better to instead just make two simple options:

  1. -advanced-layer-sink : schedules advanced layer sink
  2. -layer-sink : schedules layer sink

Alternatively an enum that has the three actually interesting states: -layer-sink=none,simple,advanced.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured since we're going to fully replace LS with ALS and removing --advanced-layer-sink, that this would have the least churn. Then, we could keep the disable-layer-sink flag as long as we find it useful. Moving to an enum would have to be reversed when we remove either flag. I'm not sure about the first idea, I guess we would have to disable layersink by default to make it work?

Copy link
Member

@seldridge seldridge Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it would have to be default of LS on and ALS off if there are two options.

(This isn't blocking in any way. Whatever you decide is fine here.)

@youngar youngar force-pushed the firtool-disable-layersink branch from 1ddaf68 to 43d7963 Compare December 13, 2024 01:30
The layer sink pass is showing some performance problems, and we want
the ability to turn it off to work around the issue, until we can
properly fix it.
@youngar youngar force-pushed the firtool-disable-layersink branch from 43d7963 to f1582ed Compare December 13, 2024 02:17
@dtzSiFive
Copy link
Contributor

LGTM! Just a thought, maybe disable layer sink entirely if it's not used presently and problematic (until ALS is enabled, which already has an option)?

@youngar youngar merged commit 0276e17 into llvm:main Dec 13, 2024
4 checks passed
@youngar youngar deleted the firtool-disable-layersink branch December 13, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIRRTL Involving the `firrtl` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants